<html xmlns:concordion="http://www.concordion.org/2007/concordion">
<link href="../../../../concordion.css" rel="stylesheet" type="text/css" />
<body>

    <h1>assertEquals</h1>

    <p>
       The <code>assertEquals</code> command evaluates an expression and compares
       the result to the contents of an element in the document. The command reports
       a success if the evaluation result is equal to the text in the document,
       or a failure otherwise. The comparisons are case-sensitive.
    </p>

    <div class="example">

        <h3>Example</h3>

        <p>Given this instrumentation:</p>

        <pre concordion:set="#snippet">&lt;span concordion:assertEquals="#user.firstName"&gt;Fred&lt;/span&gt;</pre>

        <p>We get the following outcomes depending on the evaluation result of the expression <code>#user.firstName</code>:</p>

        <table concordion:execute="#outcome = successOrFailure(#snippet, #evaluationResult)">
            <tr>
                <th concordion:set="#evaluationResult">Evaluation Result</th>
                <th concordion:assertEquals="#outcome">Outcome</th>
            </tr>
            <tr>
                <td>Fred</td>
                <td>SUCCESS</td>
            </tr>
            <tr>
                <td>Wilma</td>
                <td>FAILURE</td>
            </tr>
            <tr>
                <td>fred</td>
                <td>FAILURE</td>
            </tr>
        </table>
    </div>


    <h2>Further Details</h2>

    <ul>
        <li><a href="whitespace/Whitespace.html">Are line-breaks and other whitespace significant?</a></li>
        <li><a href="nonString/NonString.html">What if the evaluation does not return a String (e.g. int, double, null, void)?</a></li>
        <li><a href="Exceptions.html">What if the evaluation throws an exception?</a></li>
        <li><a href="NestedElements.html">Are nested HTML elements (e.g. &lt;strong&gt;) supported?</a></li>
        <li><a href="SupportedElements.html">Can this tag be used on elements other than &lt;span&gt;?</a></li>
    </ul>


</body>
</html>